//
//  GEDCOM.h
//  GEDCOMEdit Data Model
//
//  Created by Colin Begg on 11/02/2012.
//  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//

#import <Foundation/Foundation.h>

/* GEDCOMEntity
   An object representing a line of a GEDCOM file
 */
@interface GEDCOMEntity : NSObject

@property (nonatomic) int level;                    // Level within GEDCOM file
@property (nonatomic,strong) NSString *optionalXrefId;     // An optional XrefId or null
@property (nonatomic,strong) NSString *tag;                // Token for this line
@property (nonatomic,strong) NSString *optionalLineValue;  // An optional line value or null

- (id) initWithString: (NSString *)GEDCOMLine;

// Write out GEDCOM
- (BOOL) writeToFile: (NSString *)path;

@end


/* GEDCOMFile
   Represents a file of GEDCOM Entities
 */
@interface GEDCOMFile : NSObject

// Properties
@property (nonatomic,weak) NSFileHandle *fileHandle;         // Handle to the file
@property (nonatomic,strong) NSMutableArray *GEDCOMEntities;   // Array of entities in the file
@property (nonatomic,strong) NSNumber *entityCount;

// Instance Methods
- (id) initWithContentsOfFileAtURL: (NSURL *)url;

@end
